package cn.lysj.framework.common.domain;

import cn.lysj.framework.base.BaseEntity;
import cn.lysj.framework.common.RelationType;
import cn.lysj.framework.common.annotation.Relation;
import cn.lysj.framework.common.validate.annotation.NotBlank;
import cn.lysj.framework.common.validate.annotation.NotNull;
import cn.lysj.framework.common.validate.annotation.Unique;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author zk
 * @description 角色表
 * @create 2018-07-25 15:10:47
 **/
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class Role extends BaseEntity {

    @NotBlank(message = "请填写角色名")
    @Unique(message = "该角色名已存在")
    private String name;//角色名

    private Boolean defaultRole = null;//是否为注册默认角色

    @Transient
    private List<Permission> permissions;//角色拥有的权限


}